package com.azkj.album.adapter;

import android.graphics.Paint;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.azkj.album.R;
import com.azkj.album.dto.VipCardBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

public class VipCardAdapter extends BaseQuickAdapter<VipCardBean.CardDTO, BaseViewHolder> {

    public VipCardAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, VipCardBean.CardDTO item) {
        TextView nowPrice = helper.getView(R.id.tv_vip_0_0);
        nowPrice.setText(item.getMoney());

        TextView oldPrice = helper.getView(R.id.tv_vip_0_1);
        oldPrice.setText("原价 "+item.getOld_money());
        Paint paint = oldPrice.getPaint();
        paint.setFlags(Paint.STRIKE_THRU_TEXT_FLAG);


        TextView classPrice = helper.getView(R.id.tv_vip_0_2);
        classPrice.setText(item.getName());

        LinearLayout layoutPrice = helper.getView(R.id.ll_vip_0);
        if (item.isSelect()) {
            layoutPrice.setBackgroundResource(R.mipmap.ic_bg_vip_item_checked);
        } else {
            layoutPrice.setBackgroundResource(R.mipmap.ic_bg_vip_item_uncheck);
        }
    }
}
